import java.util.Collections;
import java.util.HashSet;
import java.util.Set;
import java.util.UUID;

public class TestSet {
    public static void main(String[] args) {

        Set<String> sets = Collections.synchronizedSet(new HashSet<>()); //new HashSet<>();
        Set<String> setsf =new HashSet<>();

        for (int i = 0; i <30 ; i++) {
            new Thread(()->{
                sets.add(UUID.randomUUID().toString().substring(0, 8));
                System.out.println(sets);
            },String.valueOf(i)).start();


        }



    }
}
